import request from '../utils/request'

export default {

  /**
   * 获取讲师列表
   */
  list() {
    return request({
      url: '/admin/edu/teacher/list',
      method: 'get'
    })
  },
  /**
   * 分页条件查询
   * @param page
   * @param limit
   * @param searchObj
   */
  pageList(page, limit, searchObj) {
    return request({
      url: `/admin/edu/teacher/list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  /**
   * 根据id删除
   * @param id
   */
  removeById(id) {
    return request({
      url: `/admin/edu/teacher/remove/${id}`,
      method: 'delete'
    })
  },

  removeBatch(ids) {
    return request({
      url: '/admin/edu/teacher/batch-remove',
      method: 'delete',
      data: ids
    })
  },

  save(teacher) {
    return request({
      url: '/admin/edu/teacher/save',
      method: 'post',
      data: teacher
    })
  },

  getById(id) {
    return request({
      url: `/admin/edu/teacher/get/${id}`,
      method: 'get'
    })
  },

  update(teacher) {
    return request({
      url: '/admin/edu/teacher/update',
      method: 'put',
      data: teacher
    })
  },

  selectNameListByKey(key) {
    return request({
      url: `/admin/edu/teacher/list/name/${key}`,
      method: 'get'
    })
  }
}
